﻿using Echo.Context.UltiProNet.Contexts;
using Echo.Core.TestAbstraction.WebUITest.MbUnit;
using Echo.Models.UltimateSoftware.WebUITest.MbUnit;
using MbUnit.Framework;

////*************************************************************************************************************************************
////Created by:     Yesenia Sosa
////Date created:   May 16, 2014
////Modified by: 
////Date modified: 
////Reason: 
////https://ultidev/browse/ULTI-130221 Improve Messaging on PA Local TCD screen
////*************************************************************************************************************************************

namespace Echo.Automation.Compliance.BusinessRules.PATaxCollectionDistrict
{
    [TestFixture]
    [Header("Config")]
    [Config(".NET")]
    [Author("Yesenia Sosa", "Yesenia_Sosa@ultimatesoftware.com")]
    [Category("PA Tax Collection Districts")]

    public class PATCDInfoMessages : MbUnitAutomatedTest
    {
        UltiPro UltiPro;

        [FixtureSetUp]
        public void FixtureSetUp()
        {
            UltiPro = Launch<UltiPro>();
            UltiPro.Pages.Login.LoginAs("usa-canu", "password", Config.LanguageCode);   
        }

        [FixtureTearDown]
        public void FixtureTearDown()
        {
            UltiPro.Browser.Quit();
        }

        [Test]
        public void VerifyMessageOnTCDScreen()
        {
            #region Given I am viewing the PA Tax Collection Districts Screen
            UltiPro.Menu.SystemConfiguration.Click(x => x.PATaxCollectionDistricts);
            #endregion

            #region Then The information message should be visible
            UltiPro.Pages.PaTaxCollectionDistrictsSummary.InformationMessages.Has("If you use UltiPro Tax Filing service or any third party tax filing service, DO NOT configure anything on this page. Configuring a tax collection district will cause W-2s to be incorrect.");
            #endregion 
        }

        [Test]
        public void VerifyMessageOnTCDAddScreen()
        {
            #region Given I am viewing the PA Tax Collection Districts Screen
            UltiPro.Menu.SystemConfiguration.Click(x => x.PATaxCollectionDistricts);
            #endregion

            #region When I click the Add Button
            UltiPro.Pages.PaTaxCollectionDistrictsSummary.ButtonBar.Click(btn => btn.Add);
            #endregion

            #region Then The information message should be visible
            UltiPro.Pages.PaTaxCollectionDistrictsSummary.WarningMessages.Has("If you use UltiPro Tax Filing service or any third party tax filing service, DO NOT configure anything on this page. Configuring a tax collection district will cause W-2s to be incorrect.");
            #endregion 
        }                                     
    }
}
